/* 
 * File:   dbhelper.h
 * Author: monkey
 *
 * Created on November 17, 2011, 2:17 PM
 */

#ifndef DBHELPER_H
#define	DBHELPER_H
#include <mysql.h>
#include <string>
using namespace  std;
       
class dbhelper{
private:
    
    MYSQL conn;
    MYSQL_RES *res_ptr;
    MYSQL_ROW row;
        
public:
    
    dbhelper();
    ~dbhelper();
    
    bool connect(char* host,char* username, char* passwd);
    bool connect(char* host,char* username, char* passwd,char* dbname);
    MYSQL_RES* query(char * query);
                
    MYSQL get_connect();
    
    bool setuft8();
    
    void close();
    
    char*** parse_res(int*row,int*col,int top);
    
};


#endif	/* DBHELPER_H */

